package cn.loioi.web.controller.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.loioi.util.RequestUtil;
import cn.loioi.web.common.BaseUserController;

@Controller
@RequestMapping("/admin")
public class AdminContorller extends BaseUserController {

	public AdminContorller() {
		super("admin/", "admin");
	}

	@RequestMapping("index.jspx")
	public String index(HttpServletRequest request, HttpServletResponse response, Model model) {
		return returnUrl("index", model);
	}

	@RequestMapping(value = "login.jspx")
	public String login(HttpServletRequest request, HttpServletResponse response, Model model) {
		model.addAttribute("account", RequestUtil.getValueStr(request, "account"));
		model.addAttribute("password", RequestUtil.getValueStr(request, "password"));
		return returnUrl("login");
	}

}
